import request from '@/util/request'
import type { LoginParam, Token, CodeResult } from './types'
import qs from 'qs'
const API: string = '/auth-service'

/* 验证码接口 */
export const getCode = ()=>{
    return request<CodeResult,CodeResult>({
        url:API + '/code/getCode',
        method:'GET'
    })
}


/* 登录接口 */
export const login = (loginForm:LoginParam) =>{
    return request({
        url:API + '/user/login',
        method:'POST',
        data:qs.stringify(loginForm)  // 将form对象转为 key = value 的键值对
    })
}